package com.ruoyi.Echarts.controller;


import com.ruoyi.Echarts.domain.PaperEchartsVO;
import com.ruoyi.Echarts.service.PaperEcharts;
import com.ruoyi.common.core.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.repository.query.Param;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * @PackageName:com.ruoyi.paper.controller
 * @ClassName: PaperEchartsController
 * @Description: TODO
 * @Author TZY
 * @Date 2023/3/14 21:22
 * @Version 1.0
 */
@Api("论文内容可视化展示")
@RestController
@RequestMapping("/paper/paperEcharts")
public class PaperEchartsController {

    @Autowired
    private PaperEcharts paperEcharts;

    @ApiOperation("获取每年的论文数量")
    @GetMapping("/getOption")
    public AjaxResult getOption() {
        List<PaperEchartsVO> paperEchartsVOS = paperEcharts.YearCount();
        return AjaxResult.success(paperEchartsVOS);

    }
    @ApiOperation("获取某一年的每月的论文数量")
    @GetMapping("/getOptionById")
    public AjaxResult getOptionById(String year){
        return AjaxResult.success(paperEcharts.MonthCount("2018"));
    }


    @ApiOperation("查询期刊论文数量")
    @GetMapping("/wordCloudData")
    public AjaxResult wordCloudData(){
       List<PaperEchartsVO> SourceList =  paperEcharts.PaperSource();
        return AjaxResult.success(SourceList);
    }


}
